﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using VO.Business.Controllers;
using VO.Entities;
using VO.Web.Utils;

namespace VO.Web
{
    public partial class MyDoneTracks : System.Web.UI.Page
    {
        private User _user;
        public User GetCurrentUser()
        {
            if (_user == null)
            {
                MembershipUser mUser = Membership.GetUser();
                Guid idMembership = new Guid(mUser.ProviderUserKey.ToString());
                _user = UsersController.GetUserByIdMembership(idMembership);
                Session["UserId"] = _user.Id;
            }
            return _user;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetCurrentUser();
            }
        }

        protected string GetCompletedTime(long time)
        {
            return DateTimeUtils.GetCompletedTimeString(time);
        }

    }
}